<link rel="stylesheet" type="text/css" href="css/distri.css"/>
<link rel="stylesheet" type="text/css" href="css/page.css"/>
<link rel="stylesheet" href="css/operatorRecord.css" media="all" />
<script type="text/javascript">
function cl(c){
	if(c.value=="请输入员工名称\\账号\\手机"){
		c.value="";
		c.style.color="#000";
		return;
	}
	if(c.value==""){
		c.value="请输入员工名称\\账号\\手机";
		c.style.color="#888";
		return;
	}
}
function break_off(id){
	if(confirm('确定删除？')){
		$.getJSON("call/jh_mem.php", { action:"clearAccount",mid:id}, function(json){
			if(json['status']=='success'){
				$.getJSON("call/chRela.php", { dtype:0, id:id}, function(json){
					if(json['status']!='ok'){alert(json['msg']);}
					else{alert('删除成功!');window.location.reload();}
				});
			}else{
				alert(json['msg']);
			}
		});
	}
}
function disStatus(id,sta){
    var s=sta==0?1:0;
    $.ajax({
        url: "call/jh_mem.php",
        data: { action:'SetDisMemStatus', status:s, mid:id, rm_stuff:true},
        dataType: "json",
        success: function(json){
            if(json['status']!='ok'){alert(json['msg']);}
            else{alert((sta==0?"禁用":"启用")+"成功!");window.location.reload();}
        },
        type: "post"
    });
}
</script>
<div class="r_content">
	<h3 class="mt_title">
		<span class="mttit">
			<i>+</i><a href="addoper.html">添加员工</a>
		</span>
		<span class="mctit_1">员工列表</span>
		<span class="mctit_1" style="border-bottom:0 none;"><a href="operatorRecord.html">操作日志</a></span>
	</h3>
	<!--搜索框-->
	<form>
		<div class="mtsearch" style="margin:0;">
			<b>搜索条件：</b><input type="text" class="txtinpt" name="txt" onfocus="cl(this)" onblur="cl(this)" value="<?=$txt?>" />
			<input type="submit" class="queryBtn" style="margin-left:25px;" value="查 询"/>
		</div>
	</form>
	<!--表-->
	<table class="perlistab">
		<thead>
			<th class="first">员工姓名（账号）</th>
			<th>手机号码</th>
			<th>是否停用</th>
			<th>最近登录</th>
			<th>操作</th>
		</thead>
		<tbody>
		<?	foreach($a_sort as $v){?>
			<tr>
				<td  class="txtlf"><a target="_blank" href="g_info.html?id=<?=$v['id']?>"><?=$v['dname']?>（ID:<?=$v['account']?>）</a></td>
				<td><?=$v['mobile']?></td>
				<td class="colgrn"><?=$v['zt']?></td>
				<td><?=$v['lasttime']?></td>
				<td>
					<a href="javascript:void(0);" onclick="disStatus(<?=$v['id']?>,<?=$v['status']?>)"><?=$v['cz']?></a> | <a href="javascript:void(0);" onclick="break_off(<?=$v['id']?>)">删除</a> | <a href="powguanli.html?id=<?=$v['id']?>">权限管理</a> | <a href="operPass.html?id=<?=$v['id']?>">密码重设</a>
				</td>
			</tr>
		<?	}?>
		</tbody>
	</table>
	<?page($total,$currentPage,$pageSize);?>
</div>
<iframe name="ifr" style="display:none;"></iframe>